/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 图片模块
module.exports = [
  {
    url: '/v1/info-category/\\d+/info-picture$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 29,
            'title': '渐进式 JavaScript 框架',
            'cover_image': [
              {
                'id': 3,
                'name': 'Snipaste_2022-02-28_14-34-30.png',
                'description': '',
                'path': 'static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png',
                'url': 'http://localhost:9527/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png'
              }
            ],
            'hits': 1,
            'recommend_type': [],
            'top': 1,
            'status': 1,
            'created_at': '2022-02-28 14:35:01',
            'updated_at': '2022-02-28 15:40:02'
          },
          {
            'id': 28,
            'title': '网站快速成型工具',
            'cover_image': [
              {
                'id': 2,
                'name': 'theme-index-blue.c38b733.png',
                'description': '',
                'path': 'static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png',
                'url': 'http://localhost:9527/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png'
              }
            ],
            'hits': 1,
            'recommend_type': [],
            'top': 0,
            'status': 1,
            'created_at': '2022-02-28 14:29:36',
            'updated_at': '2022-02-28 15:32:30'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 2
        }
      }
      return success(result)
    }
  },
  {
    url: '/v1/info-category/\\d+/info-picture/\\d+$',
    type: 'get',
    response: config => {
      const result = {
        'title': '渐进式 JavaScript 框架',
        'subtitle': '',
        'keywords': [
          '技术铺',
          'vuejs'
        ],
        'description': '',
        'cover_image': [
          {
            'id': 3,
            'name': 'Snipaste_2022-02-28_14-34-30.png',
            'description': '',
            'path': '/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png',
            'url': 'http://localhost:9527/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png'
          }
        ],
        'href': '',
        'href_target': '_blank',
        'rel': '',
        'recommend_type': [],
        'top': 1,
        'status': 1,
        'created_at': '2022-02-28 14:35:01',
        'image_list': [],
        'content': '<p>vuejs，一款用于构建 Web 界面，易学易用，性能出色且功能丰富的框架。</p>'
      }
      return success(result)
    }
  },
  // 添加
  {
    url: '/v1/info-category/\\d+/info-picture$',
    type: 'post',
    response: config => {
      return success({}, '添加成功')
    }
  },
  // 修改
  {
    url: '/v1/info-category/\\d+/info-picture/\\d+$',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟置顶
  {
    url: '/v1/info-category/\\d+/info-picture/\\d+/top',
    type: 'patch',
    response: config => {
      return success({}, '置顶成功')
    }
  },
  // 模拟修改状态
  {
    url: '/v1/info-category/\\d+/info-picture/\\d+/status',
    type: 'patch',
    response: config => {
      return success({}, '置顶成功')
    }
  },
  // 模拟删除
  {
    url: '/v1/info-category/\\d+/info-picture/\.*',
    type: 'delete',
    response: config => {
      return success({}, '删除成功')
    }
  }
]
